package news.dao;

import ch.qos.logback.core.util.SystemInfo;
import news.model.Comment;
import news.model.Link;
import news.model.News;
import news.model.NewsType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface FrontDao {


    List<NewsType> findNewsType();

    List<Link> findLinks();

    List<News> topNews();

    List<News> findNewsByTypeId(Integer typeid);

    News findNewsById(Integer newsid);

    @Select("select * from system_info")
    SystemInfo findsysteminfo();

    @Select("select head_photo from user where nickname=#{nickname}")
    String selectUrl(String nickname);

    List<Comment> findNewsComment(Integer newsid);
}
